import dayjs from 'dayjs';
import { objKeyTransfer, MEANS } from '../utils/convention';

export interface Manager {
  id: number;
  username: string;
  password: string;
  create_time: string;
  update_time: string;
}


export function initManager(data = {}) {
  const time = dayjs().format('YYYY-MM-DD HH:mm:ss');
  return objKeyTransfer({
    create_time: time,
    update_time: time,
    ...data,
  }, MEANS.CamelToSnake);
}

export function updateManager(data = {}) {
  const time = dayjs().format('YYYY-MM-DD HH:mm:ss');
  return objKeyTransfer({
    update_time: time,
    ...data,
  }, MEANS.CamelToSnake);
}
